package com.ddwl.goods.mapper;

import com.ddwl.common.dao.mapper.TkMapper;
import com.ddwl.goods.model.Category;
import com.ddwl.schema.bo.goods.CategorySearchBo;
import com.ddwl.schema.vo.goods.retail.ShopItemCategoryListVo;
import com.ddwl.schema.vo.goods.retail.ShopItemCategoryPageVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2019/8/8 13:56
 */
@Repository
public interface CategoryMapper extends TkMapper<Category> {

    List<Category> findChildren(@Param("params") CategorySearchBo params);

    List<Category> findTop(@Param("product") String product, @Param("mchId") String mchId);

    /**
     * 商户后台分类树状列表
     * @param category
     * @return
     */
    List<ShopItemCategoryPageVo> treeShopItemCateGory(@Param("category") Category category);

    /**
     * 小程序店铺商品分类展示
     * @param shopId
     * @return
     */
    List<ShopItemCategoryListVo> listShopItemCateGory(@Param("shopId") String shopId);

    void changeCategoryCode(@Param("map") Map<String, String> map);
}
